package com.yhq.basic.jvm.dataarea;

/**
 * Java包装类字节码文件分析
 * 自增++i和i++字节码文件分析
 * 工具：ByteCode查看
 * @author hqyin
 * @date 2024/2/20 3:10 PM
 */
public class Demo1AutoIncrAndWrapperClass {
    public static void main(String[] args) {
        //Java包装类字节码文件分析
        test_WrapperClass();
        //自增++i和i++字节码文件分析
        test_AutoIncr();

    }

    private static void test_WrapperClass() {
        Integer i1 = 10;
        Integer i2 = 10;
        System.out.println(i1 == i2);// true

        Integer i3 = 128;
        Integer i4 = 128;
        System.out.println(i3 == i4); //false

        Boolean b1 = true;
        Boolean b2 = true;
        System.out.println(b1==b2);//true

        Double d1 = 1.00;
        Double d2 = 1.00;
        System.out.println(d1==d2);//false
    }

    private static void test_AutoIncr() {
        int c = 0;
        c = c +1;
        System.out.println(c++);
        System.out.println(++c);
    }


}
